import re
html=""
with open('douban250.html','r',encoding='utf-8') as f:
    html=f.read()
# print(html)
# title_re=re.compile('<title>(.*?)</title>',re.S)
# titles=re.findall(title_re,html)
# print(titles[0])
# for t in titles:
#     print(t)



# film_re=re.compile('<div class="hd">.*?class="title">(.*?)</span>',re.S)
# titles=re.findall(film_re,html)
# print(titles)




stringre=re.compile('<div class="hd">.*?href="(.*?)".*?class="title">(.*?)</span>',re.S)
res=re.findall(stringre,html)
for i in res:
    print(f'电影详细页面是：{i[0]},电影名：{i[1]}')



